<%@ page contentType="text/html; charset=UTF-8" %>
<html>
  <head>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
 <script>
 $(function() {
	    $('select').change(function() {
	        $('#myTable').html('');
	        for (var i = 0; i<parseInt($(this).val()); i++) {
	            var row = '<tr><td><input type="text" name="dest[]" size="10" /></td>\
	                           <td><input type="text" name="destsub[]" size="10" /></td>\
	                           <td><input type="text" name="destsub1[]" size="10" /></td>\
	                           <td><input type="text" name="destsub2[]" size="10" /></td>\
	                       </tr>';
	            row = $(row);
	            $('#myTable').append(row);
	        }
	    });
	});
 </script>
<title></title>
</head>
 <body>
<select>
    <option value="select">select</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
</select>
<table id="myTable">

 </table>
</body>
</html>